<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>The Universal Relation</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'The Universal Relation' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">assertions</a></li><li><a href="index.html#8">Chapter 8: Predicates</a></li><li><b>The Universal Relation</b></li></ul></div>
<p class="purpose">To define the universal relation, which can apply and therefore subsumes all other relations.</p>

<ul class="toc"><li><a href="8-tur.html#SP1">&#167;1. Definitions</a></li><li><a href="8-tur.html#SP2">&#167;2. Family</a></li><li><a href="8-tur.html#SP3">&#167;3. Initial stock</a></li><li><a href="8-tur.html#SP4">&#167;4. Typechecking</a></li><li><a href="8-tur.html#SP5">&#167;5. Assertion</a></li><li><a href="8-tur.html#SP6">&#167;6. Compilation</a></li><li><a href="8-tur.html#SP7">&#167;7. Problem message text</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Definitions.</b></p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">VERB_MEANING_UNIVERSAL_CALCULUS_RELATION</span><span class="plain-syntax"> </span><span class="identifier-syntax">R_universal</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R_universal</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R_meaning</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Family.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::start</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::start</span></span>:<br/>Assertions Module - <a href="1-am.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BinaryPredicateFamilies::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">, </span><span class="identifier-syntax">STOCK_BPF_MTID</span><span class="plain-syntax">, </span><a href="8-tur.html#SP3" class="function-link"><span class="function-syntax">Relations::Universal::stock</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">, </span><span class="identifier-syntax">TYPECHECK_BPF_MTID</span><span class="plain-syntax">, </span><a href="8-tur.html#SP4" class="function-link"><span class="function-syntax">Relations::Universal::typecheck</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">, </span><span class="identifier-syntax">ASSERT_BPF_MTID</span><span class="plain-syntax">, </span><a href="8-tur.html#SP5" class="function-link"><span class="function-syntax">Relations::Universal::assert</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">, </span><span class="identifier-syntax">SCHEMA_BPF_MTID</span><span class="plain-syntax">, </span><a href="8-tur.html#SP6" class="function-link"><span class="function-syntax">Relations::Universal::schema</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">, </span><span class="identifier-syntax">DESCRIBE_FOR_PROBLEMS_BPF_MTID</span><span class="plain-syntax">, </span><a href="8-tur.html#SP7" class="function-link"><span class="function-syntax">Relations::Universal::describe_for_problems</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. Initial stock.</b>There are just two relations of this kind, and both are hard-wired in.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::stock</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::stock</span></span>:<br/><a href="8-tur.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">self</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">R_universal</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">BinaryPredicates::make_pair</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">BPTerms::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">), </span><span class="identifier-syntax">BPTerms::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">I</span><span class="string-syntax">"relates"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">PreformUtilities::wording</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;relation-names&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">UNIVERSAL_RELATION_NAME</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">R_meaning</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">BinaryPredicates::make_pair</span><span class="plain-syntax">(</span><span class="identifier-syntax">universal_bp_family</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">BPTerms::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">), </span><span class="identifier-syntax">BPTerms::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">I</span><span class="string-syntax">"means"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">PreformUtilities::wording</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;relation-names&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">MEANING_RELATION_NAME</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Typechecking.</b>Universality is tricky to check.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::typecheck</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::typecheck</span></span>:<br/><a href="8-tur.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">self</span><span class="plain-syntax">, </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> **</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> **</span><span class="identifier-syntax">kinds_required</span><span class="plain-syntax">, </span><span class="identifier-syntax">tc_problem_kit</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tck</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> == </span><span class="identifier-syntax">R_meaning</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0], </span><span class="identifier-syntax">K_verb</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(...), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that asks whether something means something, and in Inform 'to mean' "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"means that a particular relation is the meaning of a given verb. "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"Here, though, we have %4 rather than the name of a verb."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[1]) != </span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(...), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that asks whether something means something, and in Inform 'to mean' "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"means that a particular relation is the meaning of a given verb. "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"Here, though, we have %4 rather than the name of a relation."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0]) != </span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that asks whether something relates something, and in Inform 'to relate' "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"means that a particular relation applies between two things. Here, though, "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"we have %4 rather than the name of a relation."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[1]) != </span><span class="identifier-syntax">CON_combination</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that asks whether something relates something, and in Inform 'to relate' "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"means that a particular relation applies between two things. Here, though, "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"we have %4 rather than the combination of the two things."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rleft</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">rright</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0], &amp;</span><span class="identifier-syntax">rleft</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">rright</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cleft</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">cright</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[1], &amp;</span><span class="identifier-syntax">cleft</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">cright</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::compatible</span><span class="plain-syntax">(</span><span class="identifier-syntax">cleft</span><span class="plain-syntax">, </span><span class="identifier-syntax">rleft</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">cleft</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that applies a relation to values of the wrong kinds: we have %5, but "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"the left-hand value here is %4."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::compatible</span><span class="plain-syntax">(</span><span class="identifier-syntax">cright</span><span class="plain-syntax">, </span><span class="identifier-syntax">rright</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">kinds_of_terms</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">cright</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::tcp_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">), </span><span class="identifier-syntax">tck</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"that applies a relation to values of the wrong kinds: we have %5, but "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"the right-hand value here is %4."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">ALWAYS_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Assertion.</b>This can't be asserted; it's for use at run-time only.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::assert</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::assert</span></span>:<br/><a href="8-tur.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">self</span><span class="plain-syntax">, </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs0</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec0</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs1</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Compilation.</b>Run-time is too late to change which verbs mean what, so this relation
can't be changed at compile time, but the universal relation can.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::schema</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::schema</span></span>:<br/><a href="8-tur.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">self</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">task</span><span class="plain-syntax">, </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">annotated_i6_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">asch</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> == </span><span class="identifier-syntax">R_meaning</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax">(</span><span class="identifier-syntax">task</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEST_ATOM_TASK:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Calculus::Schemas::modify</span><span class="plain-syntax">(</span><span class="identifier-syntax">asch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">schema</span><span class="plain-syntax">, </span><span class="string-syntax">"*=-(ComparePV(*1(CV_MEANING), *2)==0)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax">(</span><span class="identifier-syntax">task</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEST_ATOM_TASK:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Calculus::Schemas::modify</span><span class="plain-syntax">(</span><span class="identifier-syntax">asch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">schema</span><span class="plain-syntax">, </span><span class="string-syntax">"*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_TEST, *&amp;))"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">NOW_ATOM_TRUE_TASK:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Calculus::Schemas::modify</span><span class="plain-syntax">(</span><span class="identifier-syntax">asch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">schema</span><span class="plain-syntax">, </span><span class="string-syntax">"*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_TRUE, *&amp;))"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">NOW_ATOM_FALSE_TASK:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Calculus::Schemas::modify</span><span class="plain-syntax">(</span><span class="identifier-syntax">asch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">schema</span><span class="plain-syntax">, </span><span class="string-syntax">"*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_FALSE, *&amp;))"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Problem message text.</b>Nothing special is needed here.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Relations::Universal::describe_for_problems</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Relations::Universal::describe_for_problems</span></span>:<br/><a href="8-tur.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">bp_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">self</span><span class="plain-syntax">, </span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="8-qr.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-am.html">1</a></li><li class="progresschapter"><a href="2-bv.html">2</a></li><li class="progresschapter"><a href="3-dlr.html">3</a></li><li class="progresschapter"><a href="4-nr.html">4</a></li><li class="progresschapter"><a href="5-id.html">5</a></li><li class="progresschapter"><a href="6-rls.html">6</a></li><li class="progresschapter"><a href="7-tc.html">7</a></li><li class="progresscurrentchapter">8</li><li class="progresssection"><a href="8-kpr.html">kpr</a></li><li class="progresssection"><a href="8-tap.html">tap</a></li><li class="progresssection"><a href="8-tcp.html">tcp</a></li><li class="progresssection"><a href="8-terr.html">terr</a></li><li class="progresssection"><a href="8-qr.html">qr</a></li><li class="progresscurrent">tur</li><li class="progresssection"><a href="8-er.html">er</a></li><li class="progresssection"><a href="8-lr.html">lr</a></li><li class="progresssection"><a href="8-aa.html">aa</a></li><li class="progresssection"><a href="8-am.html">am</a></li><li class="progresssection"><a href="8-amd.html">amd</a></li><li class="progresssection"><a href="8-abp.html">abp</a></li><li class="progresssection"><a href="8-abc.html">abc</a></li><li class="progresssection"><a href="8-abif.html">abif</a></li><li class="progresssection"><a href="8-abic.html">abic</a></li><li class="progresssection"><a href="8-cu.html">cu</a></li><li class="progressnext"><a href="8-er.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

